package com.NewtifyMe;

import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemSelectedListener;
import android.widget.Toast;


public class MyOnItemSelectedListener implements OnItemSelectedListener {
	private int min = 1;
	
	public MyOnItemSelectedListener(){
		min = 1;
	}
	
    public void onItemSelected(AdapterView<?> parent,
        View view, int pos, long id) {
    	if (parent.getItemAtPosition(pos).toString().equals("1 min") ){
    		min = 1;
    	}else if (parent.getItemAtPosition(pos).toString().equals("5 min") ){
    		min = 5;
    	}else if (parent.getItemAtPosition(pos).toString().equals("10 min") ){
    		min = 10;
    	}else if (parent.getItemAtPosition(pos).toString().equals("30 min") ){
    		min = 30;
    	}else if (parent.getItemAtPosition(pos).toString().equals("1 hour") ){
    		min = 60;
    	}else if (parent.getItemAtPosition(pos).toString().equals("a day") ){
    		min = 60 * 12 ;
    	}
    }

    public void onNothingSelected(AdapterView parent) {
      // Do nothing.
    }

	public int getMin() {
		return min;
	}

	public void setMin(int min) {
		this.min = min;
	}
}